package caro.client.gui;

import java.text.MessageFormat;
import java.util.ResourceBundle;

/**
 * Class Messages
 * @author Thanh Nhan
 * @Since Aug 28, 2011
 * @Version 1.0
 */
public class Messages {
    private static final String BUNDLE_NAME = "caro.client.gui.messages";
    private static final ResourceBundle BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, new UTF8Control());
    public static String getString(String key){
        try{
            return BUNDLE.getString(key);
        }catch(Exception e){
            return key;
        }
    }
    public static String getString(String key, Object... args){
        try{
            return MessageFormat.format(BUNDLE.getString(key), args);
        }catch(Exception e){
            return key;
        }
    }
}
